package com.zhufeng.web.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.zhufeng.base.db.DataSource;
import com.zhufeng.base.db.DataSourceType;
import com.zhufeng.web.mapper.MsgMapper;
import com.zhufeng.web.service.MsgService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName: MsgServiceImpl
 * @Description TODO
 * @author 月夜烛峰
 * @date 2022/9/5 15:06
 */
@Service
public class MsgServiceImpl implements MsgService {

    @Resource
    MsgMapper msgMapper;

    /**
     * 获取第一条消息信息
     * @return
     */
    @DataSource(value = DataSourceType.SLAVE)
    @Override
    public JSONObject showFirstMsg() {
        return msgMapper.showFirstMsg();
    }

    /**
     * 获取第一个用户信息
     * @return
     */
    @Override
    public JSONObject showFirstUser() {
        return msgMapper.showFirstUser();
    }
}
